﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="card_detail.aspx.cs" Inherits="Default3" MaintainScrollPositionOnPostback="true" Title="油卡管理 - 油卡充值消费记录明细" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style7 {
            font-size: small;
            text-align: left;
            width: 80%;
            float: left;
            display: inline;
        }

        .style21 {
            font-size: small;
        }

        .right {
            width: 18%;
            float: right;
        }

        #newdata {
            color: rgb(51, 51, 51);
            font-size: small;
            border-collapse: collapse;
        }
    </style>
    <script>
<!-- 

    top.window.moveTo(0, 0);
    if (document.all) {
        top.window.resizeTo(screen.availWidth, screen.availHeight);
    }
    else if (document.layers || document.getElementById) {
        if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
            top.window.outerHeight = screen.availHeight;
            top.window.outerWidth = screen.availWidth;
        }
    }

    //--> 
    </script>
    <script language="JavaScript" type="text/javascript" src="Js/datejs/WdatePicker.js"
        defer="defer"></script>
    <script language="JavaScript" type="text/javascript" src="Js/Calendar.js"></script>
</head>
<body background="images/login-bg.jpg">
    <form id="form1" runat="server">
        <div style="text-align: center">
            <div class="style7">
                <span>当前位置：</span><asp:HyperLink ID="HyperLink1" runat="server"
                    NavigateUrl="~/index.aspx" Style="color: #000000"
                    ToolTip="点击返回主页面">主页面</asp:HyperLink>
                <span>→ 查看</span>油卡<asp:Literal ID="lType1" runat="server" Text="充值" />记录明细<br class="style7" />
                <br />
            </div>
            <div class="right">
                <br />
            </div>
            <br />
            <div>
                <table id="table7" align="center" border="0" cellpadding="0" cellspacing="0"
                    width="95%">
                    <tr>
                        <td height="10" width="9">
                            <img align="absMiddle" border="0" height="10" src="images/l_1_1.jpg"
                                width="9" /></td>
                        <td background="images/l_1_8.jpg" width="100%"></td>
                        <td height="10" width="9">
                            <img align="absMiddle" border="0" height="10" src="images/l_1_7.jpg"
                                width="9" /></td>
                    </tr>
                    <tr>
                        <td background="images/l_1_2.jpg" class="style22"></td>
                        <td align="left" bgcolor="#ffffff" valign="top" width="100%" class="style22">
                            <table id="table8" align="center" border="0" cellpadding="0" cellspacing="0"
                                width="100%">
                                <tr>
                                    <td class="style18"><b>&nbsp; 日期范围:<asp:TextBox ID="txtTime0" runat="server" onclick="showcalendar(this)" Width="110px" />
                                        &nbsp;至&nbsp;
                                        <asp:TextBox ID="txtTime1" runat="server" onclick="showcalendar(this)" Width="110px" />
                                        办理人:<asp:TextBox ID="txtMan" runat="server" Width="110px" />
                                        类　型:<asp:CheckBox ID="cbType1" runat="server" Text="充值" ForeColor="DarkGreen" AutoPostBack="True" OnCheckedChanged="cbType_CheckedChanged" /><asp:CheckBox ID="cbType2" runat="server" Text="消费" ForeColor="Red" AutoPostBack="True" OnCheckedChanged="cbType_CheckedChanged" /><br />
                                        <br />
                                        &nbsp; 加油班组:<asp:DropDownList ID="ddlDW0" runat="server" Width="114px" DataSourceID="dsDW" DataTextField="ch_pwname" DataValueField="chejian" AppendDataBoundItems="True">
                                            <asp:ListItem Selected="True" Value="">==请选择==</asp:ListItem>
                                        </asp:DropDownList>
                                         车号:<asp:TextBox ID="txtCarNum0" runat="server" Width="110px" />
                                        持卡人:<asp:TextBox ID="txtOwner0" runat="server" Width="110px" />
                                    </b>
                                        <br />
                                        <br />

                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;
                                <asp:Label ID="Label_tiaojian" runat="server" Style="color: #FF3300"
                                    Text="Label"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        <table id="table9" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td background="images/line.jpg" height="1"></td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table id="table10" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tr>
                                                            <td align="middle" height="35" width="24%">
                                                                <img align="absMiddle" border="0" height="25" src="images/l_1_10.jpg"
                                                                    width="19" /></td>
                                                            <td align="left" style="text-align: center" width="54%">
                                                                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/sub_1.jpg"
                                                                    OnClick="ImageButton1_Click" />
                                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:ImageButton ID="ImageButton2" runat="server"
                                                            ImageUrl="~/images/sub_2.jpg" OnClick="ImageButton2_Click" />
                                                            </td>
                                                            <td align="middle" valign="center" width="22%">
                                                                <img align="absMiddle" border="0" height="15" src="images/l_1_12.jpg"
                                                                    width="49" /></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td background="images/l_1_6.jpg" class="style22"></td>
                    </tr>
                    <tr>
                        <td height="10" width="9">
                            <img align="absMiddle" border="0" height="10" src="images/l_1_3.jpg"
                                width="9" /></td>
                        <td background="images/l_1_4.jpg"></td>
                        <td height="10" width="9">
                            <img align="absMiddle" border="0" height="10" src="images/l_1_5.jpg"
                                width="9" /></td>
                    </tr>
                </table>
            </div>
            <br />
            <b>
                <br />
                油卡<asp:Literal ID="lType2" runat="server" Text="充值" />记录明细<br />
                <br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Width="90%"
                    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id,amount,balance,planid,bzname_,bzname,carnum_,carnum,lastbds"
                    DataSourceID="SqlDataSource1" EmptyDataText="没有充值数据"
                    EnableModelValidation="True" ForeColor="#333333" GridLines="None"
                    Style="text-align: center; font-size: small"
                    OnRowDataBound="GridView1_RowDataBound" PageSize="30" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" Visible="false" />
                        <asp:TemplateField HeaderText="序号" ItemStyle-ForeColor="Gray"></asp:TemplateField>
                        <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" Visible="False" />
                        <asp:BoundField DataField="changetime" HeaderText="日期" ItemStyle-Width="100" SortExpression="changetime" DataFormatString="{0:yyyy-MM-dd}" />
                        <asp:BoundField DataField="cardnum" HeaderText="卡号【车号】" SortExpression="cardnum" />
                        <asp:BoundField DataField="amount" HeaderText="充值金额（元）" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" SortExpression="amount" DataFormatString="{0:C}" />

                        <asp:BoundField DataField="jgname" Visible="false" HeaderText="加油车间" SortExpression="jgname" />
                        <asp:BoundField DataField="bzname" HeaderText="加油班组" SortExpression="bzname" />
                        <asp:BoundField DataField="carnum" HeaderText="加油车号" ItemStyle-Width="70" SortExpression="carnum" />
                        <asp:BoundField DataField="oil" HeaderText="加油量（升）" SortExpression="oil" />
                        <asp:BoundField DataField="bds" HeaderText="公里底数（KM）" SortExpression="bds" />
                        <asp:BoundField DataField="bglyh" HeaderText="百公里油耗" SortExpression="bglyh" />
                        <asp:BoundField DataField="pic" HeaderText="加油小票" ItemStyle-Width="40" SortExpression="pic" DataFormatString="<a href='upload/{0}' target='_blank'>加油小票</a>" HtmlEncode="false" />

                        <asp:BoundField DataField="balance" HeaderText="当前余额（元）" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" SortExpression="balance" DataFormatString="{0:C}" />
                        <asp:BoundField DataField="currentowner" HeaderText="持卡人" SortExpression="currentowner" ItemStyle-Width="80" />
                        
                        <asp:BoundField DataField="addname" Visible="false" HeaderText="办理人" SortExpression="addname" ItemStyle-Width="80" />
                        <asp:BoundField DataField="memo" HeaderText="备注" ItemStyle-HorizontalAlign="Left" SortExpression="memo" ItemStyle-Width="220" HtmlEncode="false" />
                        <asp:BoundField DataField="planid" Visible="false" HeaderText="燃油计划" SortExpression="planid"  />
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#336699" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>
                <br />
                <asp:Label ID="label_zongjia" runat="server"
                    Style="color: #FF0000; font-weight: 700" Visible="False"></asp:Label>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    SelectCommand="
select t.*,c.owner,c.bzname as bzname_,c.carnum as carnum_,t.cardid+'【'+ISNULL(c.carnum,'无车号')+'】' as cardnum FROM (SELECT ROW_NUMBER() over (order by changetime desc,addtime desc,id desc) as i
,* FROM  youkaguanli_card_detail) as t
left join youkaguanli_card as c on t.cardid=c.cardnum
WHERE inout=1 order by i"></asp:SqlDataSource>
                <asp:SqlDataSource ID="dsDW" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    SelectCommand="select ch_pwname,ch_pwname+'|'+bm_leibie as chejian FROM siteman WHERE (ch_pwname = '设备科') or (ch_pwname = '材料科') or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb) or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb_qiche)  or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb_fadianji) group by ch_pwname,in_id,ch_px,bm_leibie ORDER BY ch_px"></asp:SqlDataSource>

            </b>
        </div>
    </form>
    <p class="style21" style="text-align: center">
        &nbsp;<br />
        &nbsp;安康供电段信息中心制作 2015
    </p>
</body>
</html>
